package ControlLayer;



import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class StorageCtr_Test:
 * Contains test methods for the Storage controller. 
 *
 * @author  (Gruppe 3)
 * 
 */
public class StorageCtr_Test
{
    /**
     * Default constructor for test class StorageCtr_Test
     */
    public StorageCtr_Test()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

    @Test
    public void TestCreateItem()
    {
        ControlLayer.StorageCtr storageC1 = new ControlLayer.StorageCtr();
        storageC1.createItem("TestCode", "TestName", "TestType", 100, 0);
        assertNotNull(storageC1.getItem("TestCode"));
    }

    @Test
    public void TestDeleteItem()
    {
        ControlLayer.StorageCtr storageC3 = new ControlLayer.StorageCtr();
        storageC3.createItem("TestCode2", "TestName", "TestType", 20, 0);
        storageC3.deleteItem("TestCode2");
        assertNull(storageC3.getItem("TestCode2"));
    }

    @Test
    public void TestGetItem()
    {
        ControlLayer.StorageCtr storageC2 = new ControlLayer.StorageCtr();
        storageC2.createItem("TestCode3", "TestName", "TestType", 100, 0);
        assertNotNull(storageC2.getItem("TestCode3"));
    }
}



